package myaction.login;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;

public class LoginAction4 extends ActionSupport implements ServletRequestAware {

	private HttpServletRequest myRequest;
	private HttpSession mySession;
	private ServletContext myApplication;
	
	public String execute() { 
		myRequest.setAttribute("r1", "r4");
		mySession.setAttribute("s1", "s4");
		myApplication.setAttribute("a1", "a4");
		return SUCCESS;
	}
	
	@Override
	public void setServletRequest(HttpServletRequest servletRequest) {
		myRequest = servletRequest;
		mySession = myRequest.getSession();
		myApplication = mySession.getServletContext();
	}

}
